const express = require('express');
const route = express.Router();


//定义get接口
route.get('/get', (req, res) => {

    const query = req.query; //查询字符串数据
    res.send({
        status: 0, //0成功1失败
        msg: "GET 请求成功",
        data: query //请求数据
    })
})

route.post('/post', (req, res) => {
    const body = req.body;
    console.log(body);
    res.send({
        status: 0, //0成功1失败
        msg: "post 请求成功",
        data: body //请求数据
    })
})
module.exports = route;